package day1

import scala.io.StdIn
import scala.util.control.Breaks

object Test3 {
  def main(args: Array[String]): Unit = {
    /*println("请您输入数字~")
    var i:Int = StdIn.readInt()
    if (i == 1){
      println("man")
    }else {
      println("nv")
    }

    if (i == 1) println("男人结婚了")
    else println("女人跑路了~")

    println("您再输入：")
    var arr:Int = StdIn.readInt()
    var tmp = if (arr>1) "edg" else "rng"
    println(tmp)*/

    /*println("请您输入 A：春 B：夏 C：秋 D：冬 ")
    var par:String = StdIn.readLine()
    par match {
      case "A" => println("春困")
      case "C" => println("秋乏")
      case "D" => println("冬凉")
      case "B" => println("夏炎")
      case _ => println("非法输入~")
    }*/

    // 判断一个数是不是质数
   /* println("请您输入一个数字")
    var j = StdIn.readInt()
    var a1 = 2
    var flag = false
    Breaks.breakable{
      while (a1 < j){
        if (j % a1 == 0){
          flag = true
          Breaks.break()
        }
        a1 += 1
      }
    }

    if (flag){
      println(j + "不是质数")
    }else{
      println(j + "是质数")
    }*/

    // 九九乘法表
    for (i <- 1 to 9){
      for (j <- 1 to i){
        print(i + "x" + j + "=" + (i*j) + " ")
      }
      println()
    }
  }
}
